let t = require;
let e = module;
let o = e.exports;
o.default = e.exports;

('use strict');
console.log('start');
var _n89,
  i =
    (this && this.__extends) ||
    ((_n89 = function n(t, e) {
      return (_n89 =
        Object.setPrototypeOf ||
        ({
          __proto__: []
        } instanceof Array &&
          function (t, e) {
            t.__proto__ = e;
          }) ||
        function (t, e) {
          for (var o in e) {
            Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
          }
        })(t, e);
    }),
    function (t, e) {
      function o() {
        this.constructor = t;
      }
      _n89(t, e),
        (t.prototype =
          null === e
            ? Object.create(e)
            : ((o.prototype = e.prototype), new o()));
    }),
  r =
    (this && this.__decorate) ||
    function (t, e, o, n) {
      var i,
        r = arguments.length,
        a =
          r < 3
            ? e
            : null === n
            ? (n = Object.getOwnPropertyDescriptor(e, o))
            : n;
      if (
        'object' ==
          (typeof Reflect === 'undefined' ? 'undefined' : typeof Reflect) &&
        'function' == typeof Reflect.decorate
      )
        a = Reflect.decorate(t, e, o, n);
      else
        for (var s = t.length - 1; s >= 0; s--) {
          (i = t[s]) &&
            (a = (r < 3 ? i(a) : r > 3 ? i(e, o, a) : i(e, o)) || a);
        }
      return r > 3 && a && Object.defineProperty(e, o, a), a;
    };
Object.defineProperty(o, '__esModule', {
  value: !0
}),
  (o.GainCardPanel = void 0);
var a = t('UIPanel'),
  s = t('UIViewRes'),
  c = t('UILayer'),
  l = t('ComUtils'),
  u = t('SoundMrg'),
  h = t('ResMrg'),
  p = t('BattleUtils'),
  f = t('LangCfg'),
  d = cc._decorator,
  g = d.ccclass,
  _ =
    (d.property,
    (function (t) {
      function e() {
        return (null !== t && t.apply(this, arguments)) || this;
      }
      return (
        i(e, t),
        (e.prototype.onInit = function () {
          t.prototype.onInit.call(this),
            (this._vos = []),
            (this._idx = 0),
            (this._anim = this.view.getComponent(cc.Animation)),
            (this._imgTitle = l.default.getNode(this.view, 'root/imgTitle')),
            (this._txtName = l.default.getComponent(
              cc.Label,
              this.view,
              'root/icon/txtName'
            )),
            (this._imgIcon = l.default.getComponent(
              cc.Sprite,
              this.view,
              'root/icon/imgIcon'
            )),
            (this._txtDesc = l.default.getComponent(
              cc.RichText,
              this.view,
              'root/30mibaidiban/txtDesc'
            )),
            l.default
              .getNode(this.view, 'root/btnClose')
              .on(cc.Node.EventType.TOUCH_END, this.onTouchCloseHandler, this);
        }),
        (e.prototype.onLang = function () {
          l.default.getComponent(
            cc.Label,
            this.view,
            'root/huangsehengfu/New Label'
          ).string = f.LangCfg.ins.getContent(201400);
        }),
        Object.defineProperty(e.prototype, 'btnClose', {
          get: function get() {
            return l.default.getNode(this.view, 'root/btnClose');
          },
          enumerable: !1,
          configurable: !0
        }),
        (e.prototype.onShow = function () {
          t.prototype.onShow.call(this),
            this._anim.play('DefShowView'),
            (this._imgTitle.active = !1),
            this.next();
        }),
        (e.prototype.setData = function (t) {
          for (var e = 0; e < this._vos.length; e++) {
            if (this._vos[e].card.id == t.card.id) return;
          }
          this._vos.push(t);
        }),
        (e.prototype.onClose = function () {
          t.prototype.onClose.call(this),
            (this._imgIcon.spriteFrame = null),
            (this._txtName.string = ''),
            (this._txtDesc.string = ''),
            (this._vos = []),
            (this._idx = 0);
        }),
        (e.prototype.next = function () {
          if (this._idx < this._vos.length) {
            var t = this._vos[this._idx++],
              e = t.card;
            (this._imgTitle.active = t.type > 0),
              e &&
                (h.ResMrg.loadSpriteByAtlas(
                  this._imgIcon,
                  'Atlas/Battle',
                  e.icon
                ),
                (this._txtName.string = f.LangCfg.ins.getContent(e.name)),
                (this._txtDesc.string = p.default.getCardDesc(e.data)));
          } else this.view.parent && ((this.view.parent = null), this.close());
        }),
        (e.prototype.onTouchCloseHandler = function () {
          u.SoundMrg.click(), this.next();
        }),
        (e.RES = new s.UIViewRes('GainCardView', 'Battle', c.UILayer.PopLayer)),
        r([g('GainCardPanel')], e)
      );
    })(a.default));
(o.GainCardPanel = _), console.log('end');
module.exports = e.exports;
